Name

upsf95 - X11 based Fortran 95 debugger

Overview

Upsf95 is the Fortran 90/95 debugger for use with the NAGWare f95 compiler. It is a debugger with a graphical user interface, and is a modified version of the open-source debugger ``ups'' (see http://ups.sourceforge.net/main.html for more details).

The program to be debugged should be compiled and linked with the -g option.

Upsf95 runs in its own window, thus not interfering with the user program's I/O. The upsf95 window has two major areas - one showing a structured document representing the state, the other showing the source that is being executed.

Upsf95 needs little documentation for normal use, as its interface is very straightforward. While stepping through the program, the next source line to be executed is shown highlighted in the source code window, and breakpoints are shown interspersed as pseudo-code.

Upsf95 contains the same support for debugging C code as the original ups debugger.

Usage

upsf95 executable-file [core-file|process-id] [-a user-args]

Arguments

executable-file
This is the executable file for the program to be debugged, e.g. ``a.out''. This argument is required.
core-file
This optional argument is a core dump to examine, e.g. ``core''.
process-id
This optional argument indicates an existing process to which to attach upsf95, e.g. ``1077''. The process must already be executing the program to be debugged.
-a user-args
This optional pair of arguments is for passing command-line arguments to the program being debugged, e.g. ``-a arg''. To pass more than one argument, double quotes should be used, e.g. ``-a "arg1 arg2"''. The arguments may be changed from within upsf95, by editing the command line (shown near the top of the upper window); clicking the middle mouse button on this line will edit it.

Example Debugging Session

This section contains a simple example of the use of upsf95 on a small sample Fortran program.

    MODULE fh4
      REAL :: r = -HUGE(0.0)
    END MODULE fh4

    PROGRAM fh4_prog
      USE fh4
      COMMON/fh4com/i
      CALL sub(2)
      PRINT *,i,r
    END PROGRAM fh4_prog

    SUBROUTINE sub(j)
      USE fh4
      COMMON/fh4com/i
      r = 0.5*j
      i = j*3
    END SUBROUTINE sub

Assuming the above code is in the file ``sample.f90'', it may be debugged as follows: